﻿<%@ Page Title="" Language="C#" MasterPageFile="~/master/MasterPage.master" AutoEventWireup="true" CodeFile="CargosList.aspx.cs" Inherits="master_Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <link href="../css/formlist.css" rel="stylesheet" />
    <script src="../scripts/Personal/Cargo.js"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <script>
        $(document).ready(function () {
            $('#' + '<%= add.ClientID %>').button();
        });
    </script>
    <form id="form1" runat="server">
        <div style="width: 100%; height: 60px;">
            <div class="controls">
                <asp:Button ID="add" runat="server" Text="+" title="Añadir Cargo" OnClick="add_Click" />
            </div>
        </div>
        <div class="container" id="indexContainer" runat="server">
            <asp:GridView ID="grv_Cargos" runat="server" AllowPaging="True" AutoGenerateColumns="False" DataSourceID="LinqDataSource1" Width="1008px" OnRowCommand="grv_Cargos_RowCommand">
                <Columns>
                    <asp:BoundField DataField="sNombre_Cargo" HeaderText="Cargos" ReadOnly="True" SortExpression="sNombre_Cargo" />
                    <asp:BoundField DataField="iCargo_id" HeaderText="iCargo_id" ReadOnly="True" SortExpression="iCargo_id" Visible="false" />
                    <asp:TemplateField HeaderText="Opciones">
                        <ItemTemplate>
                            <a id='btnEliminar<%# Eval("iCargo_id") %>' href="javascript:deleteCargo(<%# Eval("iCargo_id") %>)">X</a>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            <asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="DAL.lqDataContext" EntityTypeName="" OrderBy="iCargo_id" Select="new (sNombre_Cargo, iCargo_id)" TableName="Tbl_Cargos" Where="iEstado_fl == @iEstado_fl">
                <WhereParameters>
                    <asp:Parameter DefaultValue="true" Name="iEstado_fl" Type="Boolean" />
                </WhereParameters>
            </asp:LinqDataSource>
        </div>
    </form>
</asp:Content>

